import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './index.less'

export default class Modal extends Component{

    componentWillMount () { }

    componentDidMount () { }
  
    componentWillUnmount () { }
  
    componentDidShow () { }
  
    componentDidHide () { }
    

    config: Config = {

    }

    render(){

        let onClick = this.props.onClick;
        let type = this.props.type || 'bottom';
        
        return (

            <View className="modal" >

                <View className="mask" onClick={onClick}></View>
                <View className={`modal-container ${type}`}>
                    {this.props.children}
                </View>

            </View>
            
        )
        
    }
    
    
}